#!/bin/bash

if [[ -f ./lib/checks.sh ]]; then
	. ./lib/checks.sh
fi

if [[ -f ./lib/connection.sh ]]; then
	. ./lib/connection.sh
fi
EXAMPLE=www.google.com

if [[ -z $WGET ]]; then
	
	if [[ -z $CURL ]]; then
		
		if [[ -z $NC ]]; then 
			echo "Error, no able to set a connection" 
			display_status ERROR
			exit;
		else
			echo "Establishing connection through NetCat"
			createconn_nc http://$EXAMPLE:80/index.php		
			createconn_nc http://$EXAMPLE/index.php		
			createconn_nc http://$EXAMPLE/index.php?a=b&b=c		
		fi
	else
		echo "Establishing connection through CURL"
		createconn_curl http://$EXAMPLE:80/index.php		
		createconn_curl http://$EXAMPLE/index.php		
		createconn_curl http://$EXAMPLE/index.php?a=b&b=c		
	fi
else
	echo "Establishing connection through WGET"
	createconn_wget http://$EXAMPLE:80/index.php		
	createconn_wget http://$EXAMPLE/index.php		
	createconn_wget http://$EXAMPLE/index.php?a=b&b=c		
fi
echo
